<table>	
	<table search="unit">
	
		<variables>
			<var_l_lower_arm value="0"/>
			<var_l_upper_arm value="0"/>
			<var_l_lower_leg value="0"/>
			<var_l_upper_leg value="0"/>
			<var_r_lower_arm value="0"/>
			<var_r_upper_arm value="0"/>
			<var_r_lower_leg value="0"/>
			<var_r_upper_leg value="0"/>
			<var_head value="0"/>
			<!-- <is_officer value="0"/> -->
			<var_ragdoll_enabled value="0"/>
			<var_hat_shot value="0"/>
			<var_hat_shot_smg value="0"/>
			<var_smg value="0"/>			
			<var_halloween_2017 value="0"/>
			<var_hat_debris value="'units/vanilla/characters/enemies/models/german_commander/debris/hat_debris'"/>
			<var_hat_debris_smg value="'units/vanilla/characters/enemies/models/german_grunt_light_test/debris/head_debris'"/>			
			<var_l_upper_arm_debris value="'units/vanilla/characters/enemies/models/german_commander/debris/l_upper_arm_debris'"/>
			<var_l_lower_arm_debris value="'units/vanilla/characters/enemies/models/german_commander/debris/l_lower_arm_debris'"/>
			<var_r_upper_arm_debris value="'units/vanilla/characters/enemies/models/german_commander/debris/r_upper_arm_debris'"/>
			<var_r_lower_arm_debris value="'units/vanilla/characters/enemies/models/german_commander/debris/r_lower_arm_debris'"/>
			<var_l_upper_leg_debris value="'units/vanilla/characters/enemies/models/german_commander/debris/l_upper_leg_debris'"/>
			<var_l_foot_debris value="'units/vanilla/characters/enemies/models/german_commander/debris/l_foot_debris'"/>
			<var_r_upper_leg_debris value="'units/vanilla/characters/enemies/models/german_commander/debris/r_upper_leg_debris'"/>
			<var_r_foot_debris value="'units/vanilla/characters/enemies/models/german_commander/debris/r_foot_debris'"/>
			<var_head_debris value="'units/vanilla/characters/enemies/models/german_commander/debris/head_debris'"/>
		</variables>
	
		<filter name="'check_hat_shot_false'">
			<check value="vars.var_smg == 0"/>		
			<check value="vars.var_hat_shot == 0"/>
		</filter>
				
		<filter name="'check_hat_shot_true'">
			<check value="vars.var_smg == 0"/>		
			<check value="vars.var_hat_shot == 1"/>
		</filter>		

		<filter name="'check_hat_shot_smg_false'">
			<check value="vars.var_hat_shot_smg == 0"/>
			<check value="vars.var_smg == 1"/>
		</filter>
		
		<filter name="'check_hat_shot_smg_true'">
			<check value="vars.var_smg == 1"/>
			<check value="vars.var_hat_shot_smg == 1"/>
		</filter>	
	
		<filter name="'check_not_halloween_ragdoll'">
			<check value="vars.var_ragdoll_enabled == 0"/>
			<check value="vars.var_halloween_2017 == 0"/>			
		</filter>

		<sequence editable_state="true" name="'spawn_helmet'" once="true" triggable="true">
			<graphic_group name="'hat_grp'" visibility="false"/>
			<body enabled="false" name="'hit_helmet'"/>
			
			<spawn_unit filter="'check_hat_shot_false'" name="vars.var_hat_debris" position="object_pos('Head')" rotation="object_rot('root_point')" transfer_ang_velocity="v( 50 * rand(), 50 * rand(), 500 * rand() )" transfer_velocity="v( 0, 0, 0 )"/>
			<spawn_unit filter="'check_hat_shot_true'" name="vars.var_hat_debris" position="object_pos('Head')" rotation="object_rot('root_point')" transfer_ang_velocity="v( 50 * rand(), 50 * rand(), 500 * rand() )" transfer_velocity="v( 0, 200 * rand(), ((100 * rand()) + 100 ))"/>
			
			<spawn_unit filter="'check_hat_shot_smg_false'" name="vars.var_hat_debris_smg" position="object_pos('Head')" rotation="object_rot('root_point')" transfer_ang_velocity="v( 50 * rand(), 50 * rand(), 500 * rand() )" transfer_velocity="v( 0, 0, 0 )"/>
			<spawn_unit filter="'check_hat_shot_smg_true'" name="vars.var_hat_debris_smg" position="object_pos('Head')" rotation="object_rot('root_point')" transfer_ang_velocity="v( 50 * rand(), 50 * rand(), 500 * rand() )" transfer_velocity="v( 0, 200 * rand(), ((100 * rand()) + 100 ))"/>
		</sequence>		

		<sequence editable_state="true" name="'ar'" once="true" triggable="true">
			<object enabled="true" name="'g_stg_hipgadget_l'"/>
			<object enabled="true" name="'g_stg_hipgadget_l_lod1'"/>
			<object enabled="true" name="'g_stg_hipgadget_l_lod2'"/>								
		</sequence>				
		
		<sequence editable_state="true" name="'officer'" once="true" triggable="true">
			<set_variables var_smg="1"/>
			<set_variables is_officer="1"/>
		
			<object enabled="false" name="'g_german_hat_visor_officers_grey'"/>
			<object enabled="false" name="'g_german_hat_visor_officers_grey_lod1'"/>
			<object enabled="false" name="'g_german_hat_visor_officers_grey_lod2'"/>	
			<object enabled="false" name="'g_mullplane'"/>	
			
			<object enabled="true" name="'g_german_hat_officer_var'"/>
			<object enabled="true" name="'g_german_hat_officer_var_lod1'"/>
			<object enabled="true" name="'g_german_hat_officer_var_lod2'"/>	
		
			<!-- <material_config name="'units/vanilla/characters/enemies/models/german_grunt_light_test/german_grunt_light_test'"/> -->
			<!-- basically thisd force him to use the default commander texture regardless if you had skin textures or not. a new hat is much simpler and still makes a small difference, I guess. -->

		</sequence>
				
		<sequence editable_state="true" name="'smg'" once="true" triggable="true">
			<object enabled="true" name="'g_smg_hipgadget_l'"/>
			<object enabled="true" name="'g_smg_hipgadget_l_lod1'"/>
			<object enabled="true" name="'g_smg_hipgadget_l_lod2'"/>								
		</sequence>				
		
		<sequence editable_state="true" name="'dismember_head_no_blood'" triggable="true">
			<object enabled="true" name="'g_neck_meat'"/>
			<set_variables var_head="1"/>
			<run_sequence name="'toggle_body_parts'" />
			<run_sequence filter="'check_ragdoll_enabled'" name="'switch_to_ragdoll'" start_time="2/30"/>
			<run_sequence name="'toggle_hit_box'" start_time="2/30"/>
			<graphic_group enabled="false" name="'head_pumpkin_grp'"/>
			<object enabled="false" name="'g_pumpkin_head'"/>
			<object enabled="false" name="'g_pumpkin_head_lod1'"/>
			<object enabled="false" name="'g_pumpkin_head_lod2'"/>
		</sequence>

		<sequence editable_state="true" name="'switch_to_ragdoll'" triggable="true">
			<set_variables var_ragdoll_enabled="1"/>
			<graphic_group name="'hat_grp'" visibility="false"/>			
			<body enabled="false" name="'hit_helmet'"/>
			<body enabled="true" name="'rag_Spine'"/>
			<body enabled="true" name="'rag_Spine1'"/>
			<body enabled="true" name="'rag_Spine2'"/>
			<body enabled="true" name="'rag_Hips'"/>
			<body enabled="true" filter="'check_intact_l_upper_leg'" name="'rag_LeftUpLeg'"/>
			<body enabled="true" filter="'check_intact_r_upper_leg'" name="'rag_RightUpLeg'"/>
			<body enabled="true" filter="'check_intact_l_lower_leg'" name="'rag_LeftLeg'"/>
			<body enabled="true" filter="'check_intact_r_lower_leg'" name="'rag_RightLeg'"/>
			<body enabled="true" filter="'check_intact_l_lower_arm'" name="'rag_LeftForeArm'"/>
			<body enabled="true" filter="'check_intact_r_lower_arm'" name="'rag_RightForeArm'"/>
			<body enabled="true" filter="'check_intact_l_upper_arm'" name="'rag_LeftArm'"/>
			<body enabled="true" filter="'check_intact_r_upper_arm'" name="'rag_RightArm'"/>
			<body enabled="true" filter="'check_intact_head'" name="'rag_Head'"/>
			<body enabled="false" filter="'check_hidden_l_upper_leg'" name="'rag_LeftUpLeg'"/>
			<body enabled="false" filter="'check_hidden_r_upper_leg'" name="'rag_RightUpLeg'"/>
			<body enabled="false" filter="'check_hidden_l_lower_leg'" name="'rag_LeftLeg'"/>
			<body enabled="false" filter="'check_hidden_r_lower_leg'" name="'rag_RightLeg'"/>
			<body enabled="false" filter="'check_hidden_l_lower_arm'" name="'rag_LeftForeArm'"/>
			<body enabled="false" filter="'check_hidden_r_lower_arm'" name="'rag_RightForeArm'"/>
			<body enabled="false" filter="'check_hidden_l_upper_arm'" name="'rag_LeftArm'"/>
			<body enabled="false" filter="'check_hidden_r_upper_arm'" name="'rag_RightArm'"/>
			<body enabled="false" filter="'check_hidden_head'" name="'rag_Head'"/>
			<constraint enabled="true" name="'Spine'"/>
			<constraint enabled="true" name="'Spine1'"/>
			<constraint enabled="true" name="'Spine2'"/>
			<constraint enabled="true" filter="'check_intact_l_upper_leg'" name="'LeftUpLeg'"/>
			<constraint enabled="true" filter="'check_intact_r_upper_leg'" name="'RightUpLeg'"/>
			<constraint enabled="true" filter="'check_intact_l_lower_leg'" name="'LeftLeg'"/>
			<constraint enabled="true" filter="'check_intact_r_lower_leg'" name="'RightLeg'"/>
			<constraint enabled="true" filter="'check_intact_l_lower_arm'" name="'LeftForeArm'"/>
			<constraint enabled="true" filter="'check_intact_r_lower_arm'" name="'RightForeArm'"/>
			<constraint enabled="true" filter="'check_intact_l_upper_arm'" name="'LeftArm'"/>
			<constraint enabled="true" filter="'check_intact_r_upper_arm'" name="'RightArm'"/>
			<constraint enabled="true" filter="'check_intact_head'" name="'Head'"/>
			<constraint enabled="false" filter="'check_hidden_l_upper_leg'" name="'LeftUpLeg'"/>
			<constraint enabled="false" filter="'check_hidden_r_upper_leg'" name="'RightUpLeg'"/>
			<constraint enabled="false" filter="'check_hidden_l_lower_leg'" name="'LeftLeg'"/>
			<constraint enabled="false" filter="'check_hidden_r_lower_leg'" name="'RightLeg'"/>
			<constraint enabled="false" filter="'check_hidden_l_lower_arm'" name="'LeftForeArm'"/>
			<constraint enabled="false" filter="'check_hidden_r_lower_arm'" name="'RightForeArm'"/>
			<constraint enabled="false" filter="'check_hidden_l_upper_arm'" name="'LeftArm'"/>
			<constraint enabled="false" filter="'check_hidden_r_upper_arm'" name="'RightArm'"/>
			<constraint enabled="false" filter="'check_hidden_head'" name="'Head'"/>
		</sequence>
		
	</table>
	
	<table search="unit/body;name=[['hit_Head']]/endurance/run_sequence;filter=[['check_not_halloween_2017']]" mode="set_values">
		<table filter="'check_not_halloween_ragdoll'" />	
	</table>

</table>